﻿using System.Diagnostics.Contracts;

namespace BlindData
{
	public static class NonPositiveGenerator
	{
		/// <summary>
		/// Returns a nonpositive random int.
		/// </summary>
		/// <returns></returns>
		public static int NonPositive(this INext<int> next)
		{
			Contract.Requires(next != null);

			return next.Between(int.MinValue, 0);
		}

		/// <summary>
		/// Returns a nonpositive random long.
		/// </summary>
		/// <returns></returns>
		public static long NonPositive(this INext<long> next)
		{
			Contract.Requires(next != null);

			return next.Between(long.MinValue, 0);
		}

		/// <summary>
		/// Returns a nonpositive random double.
		/// </summary>
		/// <returns></returns>
		public static double NonPositive(this INext<double> next)
		{
			Contract.Requires(next != null);

			return next.Between(double.MinValue, 0);
		}

		/// <summary>
		/// Returns a nonpositive random float.
		/// </summary>
		/// <returns></returns>
		public static float NonPositive(this INext<float> next)
		{
			Contract.Requires(next != null);

			return next.Between(float.MinValue, 0);
		}

		/// <summary>
		/// Returns a nonpositive random decimal.
		/// </summary>
		/// <returns></returns>
		public static decimal NonPositive(this INext<decimal> next)
		{
			Contract.Requires(next != null);

			return next.Between(decimal.MinValue, 0);
		}
	}
}
